package com.excellent.service.impl;

import com.excellent.entity.ImageRecognition;
import com.excellent.mapper.ImageMapper;
import com.excellent.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class ImageSerciveImpl extends ImageService {


    @Autowired
    ImageMapper imageMapper;


    @Override
    public void saveImageRecognization(String fileName, String result, long duration) {
        ImageRecognition imageRecognition = new ImageRecognition();
        imageRecognition.setRecognitionResult(result);
        imageRecognition.setRecognitionDuration(BigDecimal.valueOf(duration));
        imageRecognition.setImagePath(fileName);
        imageRecognition.setRecognitionModel("baidu");
        imageMapper.saveImageRecognization(imageRecognition);
    }
}
